package com.zhr.tea.presenter;

import com.zhr.tea.api.BaseSubscriber;
import com.zhr.tea.api.ExceptionHandle;
import com.zhr.tea.entity.postbean.PostBean;
import com.zhr.tea.view.impl.CarView;

/**
 * .::::.
 * .::::::::.
 * :::::::::::
 * ..:::::::::::'
 * '::::::::::::'
 * .::::::::::
 * '::::::::::::::..
 * ..::::::::::::.
 * ``::::::::::::::::
 * ::::``:::::::::'        .:::.
 * ::::'   ':::::'       .::::::::.
 * .::::'      ::::     .:::::::'::::.
 * .:::'       :::::  .:::::::::' ':::::.
 * .::'        :::::.:::::::::'      ':::::.
 * .::'         ::::::::::::::'         ``::::.
 * ...:::           ::::::::::::'              ``::.
 * ```` ':.          ':::::::::'                  ::::..
 * '.:::::'                    ':'````..
 * Created by 毛懿 on 2016/11/1 15:03.
 * 邮箱：1334964028@qq.com
 */

public class CarPresenter {

    private CarView carView;

    public CarPresenter(CarView carView) {
        this.carView = carView;
    }

    public void getCarData(PostBean postBean) {
        ModelFactory.getiCarModel().getCarData(postBean, new BaseSubscriber<String>() {


            @Override
            public void onSuccess(String str) {
                carView.onSuccess(str);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                carView.onFail(e);
            }

            @Override
            public void onFinish() {
                carView.onFinish();
            }
        });
    }

}
